package com.softeem.spider;

public class Main {

    public static void main(String[] args) {

        //1.创建爬虫对象
        Spider spider = new Spider();
        //2.设置目标网址
        spider.setUrl("http://www.goupuzi.com/thread-htm-fid-2-type-9.html");
        //3.设置爬取规则:正则表达式
        spider.setRegex("http://www.goupuzi.com/attachment/.+?\\.jpg");
        //4.设置资源存储目录
        spider.setDownloadDir("C:\\Users\\Administrator\\Desktop\\code\\img");
        //5.开始爬取
        spider.download();
    }
}
